USE 558 - Perform DSpace GET requests with automati reauthentication#13
Merged
Conversation
Why these changes are being introduced: Some testing of large harvests revealed cascading errors later in the run. Traced this back to DSpace API connections that got stale. How this addresses that need: Other routes in the dspace-rest-python client automatically refresh the connection, but GET routes currently do not. A smaller helper is added that performs GET requests, re-authenticating once if a 401 error is encountered. Side effects of this change: * Long running jobs are possible, stale connections not seen Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/USE-558
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose and background context
Why these changes are being introduced:
Some testing of large harvests revealed cascading errors later in the run. Traced this back to DSpace API connections that got stale.
How this addresses that need:
Other routes in the dspace-rest-python client automatically refresh the connection, but GET routes currently do not. A smaller helper is added that performs GET requests, re-authenticating once if a 401 error is encountered.
How can a reviewer manually see the effects of these changes?
Not easy to recreate the error, but local testing has confirmed it's hugely impactful.
The first attempt at a long running job resulted in ~47k fulltexts extracted @ 2.5 hours. With the re-authentication in place, seeing ~64k fulltexts extracted @ 50 minutes.
More successes and faster? As the connections got stale in the first run, they never recovered, but there were long retries + backoffs. So worst case happened: it took a long time to ultimately fail for last ~17k records. With the updates, we're seeing near 100% success, ignoring the DSpace items that actually don't have a
TEXTbitstream for the moment.Includes new or updated dependencies?
NO
Changes expectations for external applications?
YES: Long running jobs are possible, stale connections not seen
What are the relevant tickets?
Code review